﻿using System;

namespace FirstFloor.P2P
{
    /// <summary>
    /// Provides data for the connection StateChanged event.
    /// </summary>
    public class P2PApplicationStateEventArgs
        : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="P2PApplicationStateEventArgs"/> class.
        /// </summary>
        /// <param name="state">The state.</param>
        /// <param name="closeReason">The close reason.</param>
        public P2PApplicationStateEventArgs(P2PApplicationState state, P2PApplicationCloseReason closeReason)
        {
            this.State = state;
            this.CloseReason = closeReason;
        }

        /// <summary>
        /// Gets the state.
        /// </summary>
        /// <value>The close reason.</value>
        public P2PApplicationState State { get; private set; }

        /// <summary>
        /// Gets the close reason when state is Closed.
        /// </summary>
        /// <value>The close reason.</value>
        public P2PApplicationCloseReason CloseReason { get; private set; }
    }
}
